tools/python: Replace python string exceptions with ValueError exceptions
authorMatthias Klose <doko@debian.org>
Tue, 14 Sep 2010 16:46:21 +0000 (17:46 +0100)
committerMatthias Klose <doko@debian.org>
Tue, 14 Sep 2010 16:46:21 +0000 (17:46 +0100)
commita502f04ad66c2db8f008925920513f99fa34846d
treeb772e2cf702c8af0855fec37841f31968a58fd88
parent39b089b258c5858dddb3da6a98b6569d8b01527f
tools/python: Replace python string exceptions with ValueError exceptions

There are at least some syntax errors when trying to use the xen utils with
python2.6.  The attached patch changes these string exception into
ValueErrors:

   - tools/python/xen/util/bugtool.py (getBugTitle)
   - tools/python/xen/xend (class XendBase): not catched
   - tools/python/xen/xm/xenapi_create.py (sxp2xmlconvert_sxp_to_xml):
     the method already raises a ValueError for similiar condition.
   - tools/python/xen/xm/main.py (xm_network_attach): not catched.

For all but maybe the first one, the replacement of the string
exceptions into ValueErrors seems to be safe.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/python/xen/util/bugtool.py
tools/python/xen/xend/XendBase.py
tools/python/xen/xm/main.py
tools/python/xen/xm/xenapi_create.py